 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">

	<title>운세의 신</title>

	<link rel="stylesheet" type="text/css" href="/css/common.css">
	<link rel="stylesheet" type="text/css" href="/css/sub.css">
    <link rel="stylesheet" type="text/css" href="/css/bbs.css">
	
	<link href="/css/lib/myconfig.jquery.validate.css" rel="stylesheet" type="text/css"/>
	
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script src="/js/lib/jquery.validate.min.js" type="text/javascript"></script>
	
	<script type="text/javascript">
		
		$(document).ready(function() {
			
			// 제목 입력 안내 메세지
			var subject_msg = "제목을 입력하세요.";
			$("#subject").val(subject_msg);
			$("#subject").bind({
				focus: function() {
					if( $(this).val() == subject_msg ) {
						$(this).val('');
					}
				},
				blur: function() {
					if( $(this).val() == '') {
						$(this).val(subject_msg);
					}
				}
			});
			
			// 내용 입력 안내 메세지
			var content_msg = "욕설, 비방등 게시물의 성격과 맞지 않는 글은 관리자에 의해 삭제될 수 있습니다.";
			$("#comment").val(content_msg);
			$("#comment").bind({
				focus: function() {
					if( $(this).val() == content_msg ) {
						$(this).val('');
					}
				},
				blur: function() {
					if( $(this).val() == '') {
						$(this).val(content_msg);
					}
				}
			});
			
			// validate signup form on keyup and submit
			$("#frm").validate({
				submitHandler: function(form) {
					var subject = $("#subject").val();
					var comment = $("#comment").val();
					var userfile = $("#userfile").val();
					var service_id = $("#service_id").val();
					if (service_id == '') {
						alert('내가 본 운세를 선택해 주세요.');
						$("#service_id").focus();
					} else if (subject == '' || subject == subject_msg) {
						alert('제목을 입력하세요.');
						$("#subject").focus();
					} else if (comment == '' || comment == content_msg) {
						alert('내용을 입력하세요.');
						$("#comment").focus();
					} else if (userfile != '' && !(/.*\.(gif)|(jpg)$/.test(userfile.toLowerCase()))) {
						alert('업로드 할수 없는 파일입니다.');
					} else {
						form.submit();
					}
				}
			});
		});
	</script>

</head>
<body>

<div id="wrap">
	<!-- Header -->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/main_header.php'; ?>
	<!--// Header -->

	<!--커튼 데코레이션-->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/drape.php'; ?>
	<!--//커튼 데코레이션-->
    
    <!--컨텐츠-->
	<div id="content">
		<!--나의 정보 /배너/실시간 운세차트-->
		<div class="keybox">
			<!--나의정보-->
			<?php echo $INC_MEMBER; ?>
			<!--//나의정보-->
			
			<!--키배너-->
			<div class="key_bn"><span><img src="/images/sub/bbs/key_v1.jpg" /></span></div>
			<!--//키배너-->
			
			<!--실시간 운세차트-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/unse_chart.php'; ?>
			<!--//실시간운세차트-->
		</div>
		<!--나의 정보 /배너/실시간 운세차트-->

		<!--왼쪽 컨텐츠-->
		<div class="assistant">
			<!--왼쪽 메뉴-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/inc_lnb.php'; ?>
			<!--// 왼쪽 메뉴-->
			
			<!--추천테마-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/theme.php'; ?>
			<!--//추천테마-->
			
			<!--오늘의 추천! 무료운세-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/free.php'; ?>
			<!--//오늘의 추천! 무료운세-->
			
			<!--후기게시판-->
            <div class="side">
			<?php echo $INC_POSTSCRIPT_LIST ?>
            </div>
			<!--//후기게시판-->
			
			<!--회원배너-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/member_join.php'; ?>
			<!--//회원배너-->
		</div>
		<!--//왼쪽 컨텐츠-->

		<!-- 메인컨텐츠-->
		<div class="cont">
        <!--리스트-->
			<div class="bbs">
				<h3><?=$category_title?></h3>
				<!--게시판-->
				<div class="write">
					<form name="frm" id="frm" method="post" enctype="multipart/form-data" action="/bbs/<?=$cate?>/write_ok">
						<fieldset>
							<legend>글쓰기</legend>
							<table width="100%" summary="글쓰기" cellpadding="0" cellspacing="0">
								<caption class="blind">게시판글쓰기</caption>
								<colgroup>
									<col width="140" />
									<col width="*" />
								</colgroup>
								<tbody>
									<tr class="write">
										<th scope="row" class="writer">작성자</th>
										<td><?=$sess_userinfo['nickname']?></td>
									</tr>
									<?	if ($cate == 'postscript') : ?>
									<tr>
										<th scope="row" class="type">분류</th>
										<td>
											<select name="service_id" id="service_id" title="내가 본 운세를 선택하세요" class="input_select">
                                        		<option value="">내가 본 운세를 선택하세요</option>
                                                <option value="tojung_total">토정비결</option>
												<option value="saju_total">명품사주</option>
												<option value="star_todaybirth">오늘 태어난 스타</option>
												<option value="star_matching">나와 같은 운명의 스타</option>
												<option value="star_gunghap">나와 스타의 궁합</option>
												<option value="money_mymoney">나의 금전사주</option>
												<option value="money_ourmoney">나와 애인의 금전궁합</option>
												<option value="gunghap_mylover">내 운명의 상대는?</option>
												<option value="gunghap_sintong">신통방통 궁합</option>
												<option value="gunghap_style">내 애인은 어떤사람일까?</option>
												<option value="adult_total">19금</option>
												<option value="free">무료운세</option>
											</select>
										</td>
									</tr>
									<?	endif ?>
                                    <tr>
										<th scope="row" class="tle">제목</th>
										<td>
											<input type="text" name="subject" id="subject" size="100" maxlength="100" class="inpText" />
										</td>
									</tr>
									<?	if ($cate == 'starpt') : ?>
									<tr>
										<th scope="row" class="type">스타</th>
										<td>
											<input type="text" name="artist_idx" id="artist_idx" /> 
											<input type="text" name="artist_name" id="artist_name" />
											<input type="button" value="스타검색" id="btn_star_search" />
										</td>
									</tr>
									<?	endif ?>
									<tr>
										<th scope="row" class="tle">파일첨부</th>
										<td>
											<input type="file" name="userfile" id="userfile" />
											<span class="text">
												첨부파일은 JPG, GIF 이미지 파일만 등록 가능합니다.<br />
						   						용량은 1MB이하, 해상도는 가로 1920, 세로 1080 픽셀만 등록 가능합니다.
						   					</span>
										</td>
									</tr>
									<tr>
										<th scope="row" class="tle end">내용</th>
										<td class="con end">
											<textarea name="content" id="comment"></textarea>
										</td>
									</tr>
								</tbody>
								<tfoot>
									<tr>
										<td colspan="2" class="boardbt_area">
											<input type="image" src="/images/common/board/bt_submit.png" alt="등록하기" />
											<img src="/images/common/board/bt_cancle2.png" onclick="location.href='/';" alt="취소하기" style="cursor: pointer" />
										</td>
									</tr>
								</tfoot>
							</table>
						</fieldset>
					</form>
				</div>
				<!--//게시판-->
			</div>
			<!--//리스트--> 
		</div>
		<!--// 메인컨텐츠-->
	</div>
	<!--컨텐츠-->
	
	

	<!-- Footer -->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/main_footer.php'; ?>
	<!--// Footer -->
</div>
</body>
</html>